home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1999 March
/
EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso
/
earcd
/
devel
/
vbcc-68k-src
/
machines
/
amiga68k
/
libsrc
/
stdio
/
fseek.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-01-01
|
445b
|
21 lines
#include <stdio.h>
#include <proto/dos.h>
int fseek(FILE *f,long offset,int origin)
{
if(!f) return(1);
if(origin==SEEK_CUR){
if(f->flags&_READ) offset-=f->count;
/* if(f->flags&_WRITE) offset+=f->count;*/
}
if(f->flags&_WRITE) _flushbuf(f);
f->flags&=~(_READ|_WRITE|_EOF);
f->count=0;
if (Seek((BPTR)f->filehandle,offset,origin) == -1){
f->flags|=_ERR;
return(1);
}
return(0);
}